using UnityEngine;
using UnityEngine.SocialPlatforms.Impl;
using UnityEngine.UI; // 需要引入UI命名空间

public class UIManager : MonoBehaviour
{
    public static UIManager instance;  // 单例实例

    public GameObject GameOverUI; // 拖拽赋值UI对象

    public Text scoreText; // 引用UI Text组件

    public Text highScoreText; //最高分显示UI

    public GameObject MainUI; // 主UI界面

    public GameObject ScoreUI; // 分数界面

    public GameObject SettingUI;//设置界面



    void Awake()
    {
        // 实现单例模式
        if (instance == null)
        {
            instance = this;
        }
        else
        {
            Destroy(gameObject);  // 防止重复实例
        }
    }
    public void Start()
    {
        HideGameOverUI();
        ShowMainUI();
        HideScoreUI();
    }
    // 显示GameOverUI
    public void ShowGameOverUI()
    {
        GameOverUI.SetActive(true);
    }

    // 隐藏GameOverUI
    public void HideGameOverUI()
    {
        GameOverUI.SetActive(false);
    }


    public void ShowMainUI()
    {
        MainUI.SetActive(true);
    }

    // 隐藏GameOverUI
    public void HideMainUI()
    {
        MainUI.SetActive(false);
    }

    public void ShowScoreUI()
    {
        ScoreUI.SetActive(true);
    }

    // 隐藏GameOverUI
    public void HideScoreUI()
    {
        ScoreUI.SetActive(false);
    }

    public void ShowSettingUI()
    {
        SettingUI.SetActive(true);
    }

    // 隐藏GameOverUI
    public void HideSettingUI()
    {
        SettingUI.SetActive(false);
    }

    public void OnClickMusicButton()
    {
        //点击Music按钮
    }
    public void OnClickSoundButton()
    {
        //点击Sound按钮
    }

    public void OnClickLanguageButton()
    {
        //点击Language按钮
    }
}